package file;

import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;



public class clientFile {
	public static void main(String[] args) throws UnknownHostException ,IOException{
		Socket soc=new Socket("127.0.0.1", 1111);
		byte[]data=new byte[1024];
		FileInputStream input=new FileInputStream("C:/Users/hao huynh/Desktop/onthigk_UDPT.rar");
		DataOutputStream out=new DataOutputStream(soc.getOutputStream());
		while(true)
		{
			if((new String(data)).contains("end")){
				out.write(data);
				out.flush();
			}
			else{
				out.writeBytes("end");
				break;
			}
			soc.close();input.close();
			
		}
		System.out.println("gui thanh cong..");
	}
	
}
